package model.commands;

import ctf.network.ProtocolError;
import model.IModel;

public abstract class AbstractModelCommand {
	private int executionTime;
	/**
	 * A command to parse on the model
	 * @param delayInMs The time at which to execute it
	 */
	public AbstractModelCommand(int delayInMs) {
		this.executionTime = delayInMs;
	}
	
	/**
	 * Return the current execution time.
	 * @return the current execution time.
	 */
	public int getExecutionTime() {
		return this.executionTime;
	}
	/**
	 * Execute the command on the model.
	 * @param model The model to execute the command on.
	 */
	public abstract void execute(IModel model);
	
	/**
	 * Checks to see if the command is valid.
	 * @param model The model on which the check is made
	 * @throws ProtocolError
	 */
	public abstract void checkValid(IModel model) throws ProtocolError;
}
